class oldPlay{
    constructor(){

    }
    pay(){
        console.log('这是旧的支付');
    }
}

class newPlay{
    constructor(){
    }
    alipay(){
        console.log('这是新的支付');
    }

}
class AdapterPlay{
    constructor(){
        this.new = new newPlay()

    }
    pay(){
        this.new.alipay()
    }
}
var old = new oldPlay()
old.pay()
old = new AdapterPlay()
old.pay()
